# Windows构建器镜像
FROM mcr.microsoft.com/windows/servercore:ltsc2022

# 安装Node.js
RUN powershell -Command \
    Invoke-WebRequest -Uri https://nodejs.org/dist/v18.18.0/node-v18.18.0-x64.msi -OutFile node.msi; \
    Start-Process msiexec.exe -ArgumentList '/i', 'node.msi', '/quiet', '/norestart' -Wait; \
    Remove-Item node.msi

# 安装构建工具
# - Visual Studio Build Tools
# - Windows SDK
# - Inno Setup (for .exe)
# - WiX Toolset (for .msi)

WORKDIR /builder

COPY builder.js ./
COPY package.json ./
RUN npm install

CMD ["node", "builder.js"]
